
package com.jumei.flume.common;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

public class Constants {
    public static String CONSTS_PAGE_TYPE = "__page_type";

    public static String CONSTS_ITEM_TYPE = "__item_type";

    public static final String MATERIAL_PAGE_TYPE = "detail";
    public static final String ECPM_REDIS_KEY_PREFIX = "bi_ecpm";

    /**
     * 产品标示
     */
    public static final String SELLTYPE_MALL = "jumei_mall";
    public static final String SELLTYPE_PRODUCT = "global_mall";
    public static final String SELLTYPE_HASH = "deal";

    public static enum ACTIVITY_CONSTS {
        activity_id, activity_symbol
    }

    /**
     * URL解析规则
     */
    public static Pattern excludePage = Pattern.compile(".*jumeimall://page/search.*");
    public static Map<String, Pattern> pagePatternMap = new HashMap<String, Pattern>() {
        {
            put("Activity", Pattern.compile(
                            "^jumeimall://page/activity/detail.*|http.*jumei.com(/s/act/|/act/|/activity/detailv2)"));
            put("Detail", Pattern.compile(
                            "^jumeimall://page/(detail|alldetail|grouponproduct)|http.*jumei.com/((yiqituan|product)/detail[^Secret]|s/coutuan/)"));
            put("Store", Pattern
                            .compile("^jumeimall://page/storedetail.*|http.*jumei.com/(shop|pop/store|(s/|)store).*"));
        }
    };
}
